<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered ">
	<div class="modal-content">
					<div class="modal-header">
						<h6 class="modal-title">编辑商品规格</h6>
						<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
					</div>
					<div class="modal-body">
					<form id="goodsSpec-edit-form" onsubmit="goodsSpec.update();return false;">
					#include("_form.html")
					</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Close">关闭</button>
						<button type="button" class="btn btn-primary" onclick="goodsSpec.update();">保存</button>
					</div>
				</div>
</div>

<script type="application/javascript">
$(function() {
	// 初始化bootstrap相关组件
	common.initBootstrap();
	formInput.listenkeyUp("#goodsSpec-edit-form");
	
});

goodsSpec.update = function() {
	var result = goodsSpec.formChecking();
	if(!result) {
		return;
	}
	beekit.ajaxPost("/goods/goods/spec/update", $("#goodsSpec-edit-form").serialize(), function(ret) {
		beekit.msg(ret);
		if (ret.state == "ok") {
			beekit.modalClose();
			goodsSpec.list(#(goodsSpec.id));
		}
	});
};

</script>
